//
//  MyComplainTimeTableViewCell.m
//  PropertyManager
//
//  Created by TNG on 2018/7/18.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "MyComplainTimeTableViewCell.h"

@implementation MyComplainTimeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.separatorInset = UIEdgeInsetsMake(0, 0, 0, MAXFLOAT);
    }
    return self;
}

-(void)creatUI{
    [self.contentView addSubview:self.timeLabel];
    [self.contentView addSubview:self.stateLabel];
}

-(UILabel *)timeLabel
{
    if (_timeLabel == nil) {
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(120, 10, WIDTH - 140, 20)];
        _timeLabel.font = font(14);
        _timeLabel.textAlignment = NSTextAlignmentRight;
    }
    return _timeLabel;
}

-(UILabel *)stateLabel
{
    if (_stateLabel == nil) {
        _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 80, 20)];
        _stateLabel.font = font(14);
        _stateLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _stateLabel;
}

-(void)send
{
    self.timeLabel.text = @"提交时间：2月24日 上午11点";
    self.stateLabel.text = @"已提交";
}

-(void)sendMyComPlainModel:(MyComPlainModel *)model
{
    self.timeLabel.text = [NSString stringWithFormat:@"提交时间：%@%@",model.tsDate,model.tsTime];
    if ([model.spJs isEqualToString:@"Y"]) {
        self.stateLabel.text = @"已回复";
        self.stateLabel.textColor = SFMWhiteColor;
        self.timeLabel.textColor = SFMWhiteColor;
        self.backgroundColor = SFMNavBarColor;
    }else
    {
        self.stateLabel.text = @"待处理";
        self.timeLabel.textColor = SFM153;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
